var ObjectId = require('mongodb').ObjectID;
var mongoose = require('./MongooseDB');
var ModelBase = require('./modelBase');

function GeoFeature(gf) {
    if(gf != null)
    {
        this._id = gf._id;
        this.MetaID = gf.MetaID;
        this.FeatureID = gf.FeatureID;
        this.ID = gf.ID;
        this.Event = gf.Event;
        this.Place = gf.Place;
        this.Thing = gf.Thing;
        this.Time = gf.Time;
        this.Person = gf.Person;
        this.Phenomenon = gf.Phenomenon;
        this.Scene = gf.Scene;
    }
    else
    {
        this._id = new ObjectId();
        this.MetaID = '';
        this.FeatureID = '';
        this.ID = '';
        this.Event = null;
        this.Place = null;
        this.Thing = null;
        this.Time = null;
        this.Person = null;
        this.Phenomenon = null;
        this.Scene = null;
    }
    return this;
}

GeoFeature.__proto__ = ModelBase;
GeoFeature.modelName = 'SemanticTag';
module.exports = GeoFeature;

var GeoFeatureSchema = new mongoose.Schema({
    MetaID : String,
    FeatureID : String,
    ID : String,
    Event : mongoose.Schema.Types.Mixed,
    Place : mongoose.Schema.Types.Mixed,
    Thing : mongoose.Schema.Types.Mixed,
    Time : mongoose.Schema.Types.Mixed,
    Person : mongoose.Schema.Types.Mixed,
    Phenomenon : mongoose.Schema.Types.Mixed
}, {collection : 'SemanticTag'});

var GeoFeatureModel = mongoose.model('SemanticTag', GeoFeatureSchema);
GeoFeature.baseModel = GeoFeatureModel;